	--Physgun Limiter
	--Made by Thrasher1018
	--Also made by cg123 and Kalinium

function antidoor_phys ( ply, ent )

	-- Some entities specifically forbid physgun interaction
	if ( ent:GetTable().PhysgunDisabled ) then return false end
	if string.find(ent:GetClass(), "prop_dynamic_") then return false end
	if string.find(ent:GetClass(), "prop_dynamic_") then return false end
	if string.find(ent:GetClass(), "_door") then return false end
	if string.find(ent:GetClass(), "func_") then return false end
	-- Don't pick up players
	if ( ent:GetClass() == "player" ) then return false end
	if string.find(ent:GetClass(), "door_") then return false end
	ply:SendHint( "PhysgunFreeze", 2 )
	ply:SendHint( "PhysgunUse", 8 )
	
	return true
	
end

function antidoor_tool (ply,tr,mode)
	if tr.Entity ~= nil then
		if string.find(tr.Entity:GetClass(),"func_") or string.find(tr.Entity:GetClass(),"_door") or string.find(tr.Entity:GetClass(), "prop_dynamic_") or string.find(tr.Entity:GetClass(), "prop_dynamic") 
		then return false end
end
	return true
	end
	
hook.Add( "CanTool", "antidoor_tool", antidoor_tool ); 
hook.Add( "PhysgunPickup", "antidoor_phys", antidoor_phys ); 
